package kr.hkit.powerjava.alone.vo;

import java.io.Serializable;

public class User implements Serializable, Comparable<User> {

	private static final long serialVersionUID = -3678161870183058015L;

	private int userNum;
	private String userName;
	private String city;

	public User(int userNum, String userName) {
		super();
		this.userNum = userNum;
		this.userName = userName;
	}

	public User(int userNum, String userName, String city) {
		super();
		this.userNum = userNum;
		this.userName = userName;
		this.city = city;
	}

	@Override
	public int compareTo(User o) {
		return userNum - o.userNum;
	}

	@Override
	public boolean equals(Object obj) {
		boolean result = false;
		if (obj instanceof User) {
			User temp = (User) obj;
			result = (userNum == temp.userNum && userName.equals(temp.userName));
		}
		return super.equals(obj);
	}

	@Override
	public String toString() {
		return "User [userNum=" + userNum + ", userName=" + userName
				+ ", city=" + city + "]";
	}

	public int getUserNum() {
		return userNum;
	}

	public void setUserNum(int userNum) {
		this.userNum = userNum;
	}

	public String getUserName() {
		return userName;
	}

	public void setUserName(String userName) {
		this.userName = userName;
	}

	public String getCity() {
		return city;
	}

	public void setCity(String city) {
		this.city = city;
	}

}
